package stv5.abstracted;

import java.util.HashMap;
import java.util.List;

import stv5.Episode;
import stv5.Request;
import stv5.Series;
import stv5.SeriesList;

public interface EpisodeManager {
	/**
	 * Add links and stuff for any Manager-specific settings
	 * 	stuff, to be handled by handleRequest
	 * 
	 * @param list A HashMap mapping the link text -> link url
	 */
	public void appendSettingsList(HashMap<String, String> list);
	
	/**
	 * @param seriesId
	 * @return A list of episodes for series with ID
	 */
	public List<Episode> getEpisodes(int seriesId);
	
	/**
	 * @param s
	 * @param e
	 * @return Return the full, local path to the episode "e"
	 * 	for series "s"
	 */
	public String getLocalForEpisode(Series s, Episode e);
	
	/**
	 * Handle any non-standard Settings-related requests
	 * @param buff 
	 * @param request
	 */
	public void handleRequest(StringBuffer buff, Request request);
	
	/**
	 * Add a series to be managed by this Manager object.
	 *  This method also looks up this series' episodes and
	 *  saves them for future reference;
	 * 
	 * @param Series
	 */
	public void manageSeries(Series s);
	
	/**
	 * This instructs the EpisodeManager to ensure that
	 * 	its data is up to date
	 */
	public void reload();
	
	/**
	 * @return The number of series whose episodes are
	 * 	managed by this manager
	 */
	public int size();
	
	/**
	 * Spider through all folders, starting at root
	 * 
	 * @return A HashMap with the foldername->guid
	 */
	public SeriesList spiderFolders();
	
	/**
	 * Spider through all folders, starting at the given folder name
	 * 
	 * @see #spiderFolders()
	 */
	public SeriesList spiderFolders(String folderName);

	

	
}
